Skip to content

feat: extract weapon stats to global variable / no impact on functionality#1080

Merged
OH296 merged 3 commits intoAdeptus-Dominus:mainfrom
cyotas:main
Dec 26, 2025
Merged

feat: extract weapon stats to global variable / no impact on functionality#1080
OH296 merged 3 commits intoAdeptus-Dominus:mainfrom
cyotas:main

Conversation

@cyotas
Copy link
Contributor

@cyotas cyotas commented Dec 25, 2025

Purpose and Description

Weapons stats have been extracted from switch cases into a global variable.
Special effects (poison weapons deal more damage against weakness to poison, siege weapons bonus range vs forts) have been converted into tags (Special: "Poison", "Siege") with comments describing what those effects actually did, to-be-unified later.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Expanded weapon definitions across multiple factions with enhanced attributes including attack power, armour penetration, range, and splash damage capabilities.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Tech-Priest: repository ignores two sprite cache artefacts, an audio group's identifier was cleared in the project manifest, and a large, public global.en_weapons dictionary of weapon definitions was added to the weapon script.

Changes

Cohort / File(s) Summary
Build System Configuration
\.gitignore
Added sprites.import.json and sprites.info.json ignore entries with comments describing machine-specific tracking and caching.
Project Manifest
ChapterMaster.yyp
Cleared the $GMAudioGroup/version field for an audio group entry (set to empty string); other audio group fields unchanged.
Weapon Data Archive
scripts/scr_en_weapon/scr_en_weapon.gml
Introduced public global.en_weapons: a large structured dictionary of weapon definitions across factions with fields like attack, armor_penetration, range, splash, and optional ammo/special.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

PR: Refactor, Size: Big

Suggested reviewers

  • EttyKitty

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete; it omits the 'Testing done' and 'Related things and/or additional context' sections required by the template. Complete the description by adding 'Testing done' section documenting tests performed, and 'Related things' section with any relevant context, PRs, or documentation links.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title follows conventional commits format with 'feat' type and clear scope, accurately describing the primary change of extracting weapon stats to global variables.

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 183edeb and 9aa6311.

📒 Files selected for processing (1)
  • scripts/scr_en_weapon/scr_en_weapon.gml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Type: CI Continuous Integration changes Size: Huge labels Dec 25, 2025
coderabbitai[bot]
coderabbitai bot previously requested changes Dec 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a40af07 and 183edeb.

📒 Files selected for processing (3)
  • .gitignore
  • ChapterMaster.yyp
  • scripts/scr_en_weapon/scr_en_weapon.gml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

**/*.gml: - Constants of macro type MUST have a space between the constant name and its value. Without it, the compiler will throw an error.

Files:

  • scripts/scr_en_weapon/scr_en_weapon.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Do not prioritize the shortest code. Prioritize code that explicitly reveals its intent.

  • Understandable variable naming is extremely important.
  • If a solution is "clever" but hard to parse mentally, request a refactor to a more verbose but clearer approach.
  • Apply the "Rule of Three": suggest abstraction when logic is repeated three times or more times.
  • For subjective improvements (naming, architectural choice), do not give a concrete suggestion immediately. Instead, ask a guiding question to prompt the user's reflection.
  • Every suggestion for a code change must include a brief justification.
  • If a TODO comment is added, ask the user if you should create a GitHub issue for this TODO.
  • If a TODO comment is deleted, remind the user if there is an active GitHub issue related to that comment.

Files:

  • scripts/scr_en_weapon/scr_en_weapon.gml
  • ChapterMaster.yyp
🧠 Learnings (3)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
📚 Learning: 2025-03-29T10:30:25.598Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.

Applied to files:

  • scripts/scr_en_weapon/scr_en_weapon.gml
📚 Learning: 2025-06-16T17:12:13.045Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

Applied to files:

  • scripts/scr_en_weapon/scr_en_weapon.gml
🔇 Additional comments (3)
.gitignore (1)

18-21: Sprite cache artefacts rightly consigned to the void

Tech-Priest, ignoring sprites.import.json and sprites.info.json is appropriate for machine-specific import and cache state, and the comments document the override path clearly. No further changes demanded by the machine spirit.

ChapterMaster.yyp (1)

5-5: Verify audiogroup identity normalisation for audiogroup_default

Tech-Priest, the $GMAudioGroup field for audiogroup_default now bears an empty string rather than a version tag. This looks like an IDE-generated normalisation, but it does alter the serialized identity of the audio group.

Confirm this change was produced by your current GameMaker version and that other Magi are aligned on the same toolchain, lest divergent IDEs continually rewrite this field.

scripts/scr_en_weapon/scr_en_weapon.gml (1)

1192-1198: Canonical weapon nomenclature harbours silent failures waiting to manifest

Tech-Priest, the sanctified weapon designations revealed here possess cunning merit. Yet the archives contain lingering aberrations: "Twin-Linked Heavy Bolters" (accursed hyphenation) versus "Twin Linked Heavy Bolters" coexist in the ancient case structures, whilst generic phantoms—"Claws", "Autogun", "Flamer"—persist where faction precision now reigns.

When other systems begin venerating global.en_weapons, such orthographic discrepancies shall birth silent lookup failures, cryptic failures of the darkest kind.

Contemplate thy design path:

  • Inscribe a normalisation mechanism (mapping corrupted spellings to sanctified keys), or
  • Purify all weapon invocations across the codebase to emit only canonical identifiers

This architectural decision, deferred though it may be, must be crystallised ere the machine spirits grow restless with creeping entropy.

⛔ Skipped due to learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: datafiles/data/psychic_powers.json:253-270
Timestamp: 2025-03-09T02:23:07.284Z
Learning: The "Kamehameha" power name in the psychic powers system should be preserved as an artifact of the original codebase, despite it being a non-Warhammer 40k reference.
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.

@cyotas cyotas changed the title Globalised enemy weapon stats feat: extract weapon stats to global variable / no impact on functionality Dec 25, 2025
@github-actions github-actions bot added the Type: Feature Adds something new label Dec 25, 2025
@OH296 OH296 enabled auto-merge (squash) December 26, 2025 01:52
@OH296 OH296 merged commit bcedde6 into Adeptus-Dominus:main Dec 26, 2025
3 checks passed
@OH296
Copy link
Collaborator

OH296 commented Dec 26, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Huge Type: CI Continuous Integration changes Type: Feature Adds something new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants